using System;

namespace Framework.Library.Core.Utils.Miscellaneous
{
    public delegate void EventCallBack<T>(EventResult<T> result);

    public delegate void EventCallBack(EventResult result);

    public class EventResult<TReturn> : EventResult
    {
        private readonly TReturn _returnValue;

        public EventResult(TReturn returnValue)
            : this(returnValue, null)
        {
        }

        public EventResult(TReturn returnValue, Exception eventException)
            : base(eventException)
        {
            _returnValue = returnValue;
        }

        public TReturn ReturnValue
        {
            get { return _returnValue; }
        }
    }

    public class EventResult
    {
        private readonly Exception _eventException;

        public EventResult()
        {
        }

        public EventResult(Exception eventException)
        {
            _eventException = eventException;
        }

        public Exception EventException
        {
            get { return _eventException; }
        }
    }
}